<?php
require('inc/function.php');
$id= $_GET["id"];
$content=file_get_contents('http://www.xiami.com/widget/xml-single/sid/'.$id[1]); //获取组合地址内容
preg_match("/<\!\[CDATA\[([^\]].*)\]\]><\/location>/i",$content,$location);//匹配location内容
$xiami=getSongUrl($location[1]); //转码得到正确的地址
header('Content-Type:application/force-download'); //强制下载
header("Location:".$xiami);
?>